#include "rtda/heap/cp_classref.h"
#include "rtda/heap/constant_pool.hpp"
#include "classfile/class_file.hpp"

namespace jvm {
namespace heap {

ClassRef::ClassRef(std::shared_ptr<ConstantPool> pCp, const std::string& className) {
    m_pCp = pCp;
    m_className = className;
}

std::shared_ptr<ClassRef> ClassRef::newClassRef(std::shared_ptr<ConstantPool> pCp, const std::shared_ptr<classfile::ConstantClassInfo> pClassInfo) {
    return std::make_shared<ClassRef>(pCp, pClassInfo->get_name());
}

} // namespace heap
} // namespace jvm